<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			var arr = [0, 9, 0, 9, 78, 6, 5];
			var arrNew = [];
			for (var i in arr) {
				if (arr[i] !== 0) {
					arrNew.push(arr[i]);
				}
			}
			console.log(arrNew);
		</script>
	</body>

</html>